<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 function check_session_timeout(){
 	$CI =& get_instance();
	$controller = $CI->uri->rsegments[1];
	$method = $CI->uri->rsegments[2];
	if( $controller === 'welcome'||
		$controller === 'signins'&&$method !== 'home'||
		$controller === 'members'&&$method === 'ads'||
		$controller === 'members'&&$method === 'clicked'||
		$controller === 'enameServiceForUop'||
		$controller === 'queryinputs'||
		$controller === 'verfycode'
		
	){// donothing
	}else if(!$CI->session->userdata('id')){
		//echo show_msg('您还没有登录或登录已超时,请先登录.','http://uop.k.cn',2,true);
		//exit;
	}
}
function prepare_frame(){
	global $current_screen;
	$CI =& get_instance();
	
	$controller = $CI->uri->rsegments[1];
	$method = $CI->uri->rsegments[2];
	$current_screen = "$controller/$method";
	
	// JD_BASE
	define('JD_BASE', 'jd_base/');

	// yaml
	css_enqueue('central');
	js_enqueue('lib/jquery-1.4.2.min');
	
	// wp menu
	css_enqueue('wp-global','wp-colors','wp-admin');
	css_enqueue('wp-mod' );
	css_enqueue('menu' );
	if (strpos($_SERVER["HTTP_USER_AGENT"],'MSIE') !== false){
		css_enqueue('wp-iehacks' );			
	}
	js_enqueue('wp-utils','hoverIntent.dev','component/jd-mouse-action-cls');
	js_enqueue('wp-common');
	
	// 加载系统插件
	if ( defined('JD_ENABLE_PLUGIN') && JD_ENABLE_PLUGIN === TRUE ){
		jd_load_all_plugin();
	}	
//	require_once(APPPATH.'plugins/my_plugin.php');
}

function hook_display(){
	global $title;
	$CI =& get_instance();
	$controller = $CI->uri->rsegments[1];
	$method = $CI->uri->rsegments[2];
	$content = $CI->output->get_output();
	
	// add screen meta
	add_action('before_content','screen_meta');
	
	// render the page via template
	$data = array(
				'title' => $title,
              	'menu'=> do_filter('menu',$CI->load->view(JD_BASE.'menu','',true)),
              	'javascript' => js_export(true),
              	'css' => css_export(true),
              	'content'=> $content
	);
	echo $CI->load->view(JD_BASE.'jd_template', $data,true);
}

/* End of file */